cmake_minimum_required(VERSION 3.10)
project(spdlog_examples)

set(CMAKE_CXX_STANDARD 17)

# 本地导入第三方库【前提：已经安装了spdlog】
find_package(spdlog CONFIG REQUIRED)

# 依赖的.h头文件目录
include_directories(../../common)

set(USED_LIBS spdlog::spdlog)    # 设置变量: USED_LIBS

# 生成可执行文件
add_executable(sl_test01_simple     test01_simple.cpp)
add_executable(sl_test02_multi_sink test02_multi_sink.cpp)
add_executable(sl_test03_stream     test03_stream.cpp)

# 添加链接库：可执行文件名 访问权限 链接spdlog库名
target_link_libraries(sl_test01_simple     PRIVATE ${USED_LIBS})
target_link_libraries(sl_test02_multi_sink PRIVATE ${USED_LIBS})
target_link_libraries(sl_test03_stream     PRIVATE ${USED_LIBS})
